refactor(docs): consume layer plumbing instead of forking it - #330
Merged
Merged
Conversation
`@uxfront/layer-docs` now ships the collections builder options, the
locale files, the Content Studio schema and the Vite prebundle hints, so
the local forks are dead weight. Net -2150 lines.
- `content.config.ts`: 118 lines -> 11. `defineDocsCollections(DOCS_SECTIONS,
{ sitemap: true, changelog: true })`. Section topology stays local in
`app/constants/sections.ts`; the collection shapes, per-locale fan-out and
schemas come from the layer.
- Deleted `i18n/locales/` (31 files), `nuxt.schema.ts`,
`modules/optimizeDeps.ts` and `modules/useDocusI18nOverride.ts`. That
module's own docblock said to remove it once the package shipped its
locales; it does now.
- Deleted 18 shadow copies that re-declared layer files at the same relative
path. Layer precedence meant every upstream fix to those files was
invisible here — notably the `AppHeader` anchor-nesting a11y fix, which is
now actually in effect (verified: max anchor nesting depth 1 in the
prerendered header).
- Deleted `utils/prerender.ts`; the layer's `app/utils/prerender.ts` is
equivalent and auto-imported, so the explicit relative import goes too.
- `app.config.ts` declares `docsTheme.frameworks` (React/Vanilla/Vue, order
preserved). The layer no longer ships a default list.
Four shadows are kept deliberately, each now carrying a docblock naming its
delta and its deletion trigger:
- `useDocsSections.ts` — the `THEME_SUBSECTIONS` split is a styleframe
content shape. Rebased onto the layer copy, which adds the missing
`hasSectionSwitcher`; without it the layer's `AppSubHeader` read
`undefined` and the docs sub-header never rendered.
- `DocsAsideLeftBody.vue` — theme-subsection nav filter and the `ProIcon`
badge.
- both `[...slug].vue` pages — `defineOgImage`; `nuxt-og-image` and the
`DocsSatori` template are registered here, not in the theme. Rebased to
take the layer's `USeparator decorative` a11y fix.
- `app/types/non-route-categories.ts` — a deliberate duplicate, because
`modules/nonRouteCategories.ts` imports it by relative path at build time
and that module has not moved into the layer yet.
Requires @uxfront/layer-docs@0.2.0, which is not published yet.
Refs UXF-119, UXF-3
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
It imported `~~/i18n/locales/en.json`, which moved into `@uxfront/layer-docs` with the rest of the locale files, and it had zero call sites — the layer's `useDocusI18n` is what the components actually use. Its docblock also referenced `apps/shared/modules/config.ts`, a path that does not exist in this repo, so it had been dead for a while.
The pin moved to ^0.2.0 with the layer extraction, but the lockfile still resolved 0.1.0 because that release did not exist yet. It does now, so the entry is regenerated against the registry — no local override.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@uxfront/layer-docsnow ships the plumbing this app was forking. Deletes the forks. Net -2150 lines.Companion to uxfront-com/uxfront#56. Sub-issue of UXF-3 (layer/app boundary audit).
Important
Blocked on release. This pins
@uxfront/layer-docs@^0.2.0, which is not published yet. uxfront#56 must merge and publish first, thenpnpm-lock.yamlregenerates. Draft until then.What went away
content.config.ts: 118 lines → 11.defineDocsCollections(DOCS_SECTIONS, { sitemap: true, changelog: true }). Section topology stays local inapp/constants/sections.ts; collection shapes, per-locale fan-out and schemas come from the layer.i18n/locales/(31 files),nuxt.schema.ts,modules/optimizeDeps.ts,modules/useDocusI18nOverride.ts. That last module's own docblock said to delete it once the package shipped its locales — it does now.AppHeaderanchor-nesting a11y fix is now actually in effect — verified against the prerendered HTML: max anchor nesting depth in<header>is 1.utils/prerender.ts— the layer'sapp/utils/prerender.tsis equivalent and auto-imported, so the explicit../../../../../utils/prerenderimport goes too.What arrived
app.config.tsdeclaresdocsTheme.frameworks— React / Vanilla / Vue, order preserved from the deletedDEFAULT_FRAMEWORKS. The layer no longer ships a default list (which frameworks a site documents is a site fact), so this array is now the only source.Shadows kept, deliberately
Each now carries a docblock naming its delta and its deletion trigger:
app/composables/useDocsSections.tsTHEME_SUBSECTIONSsplit — a styleframe content shapeapp/components/docs/DocsAsideLeftBody.vueProIconbadgeapp/pages/[[lang]]/[...slug].vuedefineOgImageapp/pages/[[lang]]/docs/[section]/[...slug].vuedefineOgImageapp/types/non-route-categories.tsmodules/nonRouteCategories.tsmoves into the layer (UXF-3 #5)Two of these were rebased onto the layer copy, picking up fixes they had been shadowing:
useDocsSections.tsgained the missinghasSectionSwitcher. Without it the layer'sAppSubHeaderreadundefinedand the docs sub-header never rendered — a live bug this PR fixes as a side effect.<USeparator decorative>a11y fix (aseparatorrole with focusable descendants is anested-interactiveviolation).Test plan
Verified against a packed tarball of uxfront#56 (
npm pack+pnpm.overridesfile:), since 0.2.0 isn't on npm yet. The override was reverted before committing — the diff here contains no local-path scaffolding.nuxt prepare— clean, types generated.pnpm build— Build complete, 60.5 MB. No errors (sourcemap/sharp warnings only).autoSubfolderIndex: false, so routes emit as<path>.html).pnpm test— 3 passed.pnpm test:build— 2 passed. Brand-palette guardrails hold.oxlint apps/docsclean;oxfmt --checkclean over 36 files.AppHeaderanchor-nesting fix confirmed live in.output/public/index.html.